Add Book to My BookshelfPurchase This Book Online

Chapter 14 - Configuring OSPF

Cisco & IP Addressing
Louis D. Rossi, Louis R. Rossi and Thomas Rossi
  Copyright © 1999 The McGraw-Hill Companies, Inc.

Chapter 14: Configuring OSPF
Objective
Open Shortest Path First (OSPF) is a “newer” routing protocol that was developed in the late 80s and early 90s. It is a standard and can be configured on all routers regardless of vendor. This fact is the major reason why you may not want to use EIGRP. If you have a mix of routers, for instance Bay and Cisco, OSPF will be the routing protocol to use; EIGRP requires all routers to run the Cisco IOS.
OSPF is a classless, link-state routing protocol that supports VLSM.
Single-Area Topology
Figure 14.1 shows that we will use the “serial mask” on our serial links; as a result we will preserve address space.
Figure 14.1  OSPF Single-Area–Four-Router Topology
Table 14.1  Addresses to be used for Figure 14.1
S0
S1
S2
E0
Router_A
172.16.0.10
N/A
N/A
10.10.1.1/24
Router_B
172.16.0.9
172.16.0.13
172.16.0.5
N/A
Router_C
172.16.0.14
N/A
N/A
10.10.3.33/28
Router_D
172.16.0.6
N/A
N/A
10.10.3.17/28
Mask
255.255.255.252
255.255.255.252
255.255.255.252
Configuration Commands
Figure 14.2 illustrates the commands to configure IP addresses and OSPF on all routers. For this first example, all networks will be configured in area 0.
We will use an OSPF process ID of 100; any number can be chosen between 1 and 65,535. The important point to remember is, when a number is chosen, use it consistently. If another process ID is chosen, redistribution will be required.
Figure 14.2 illustrates one way of configuring OSPF by identifying each interface with the appropriate area. The wild card mask of 0.0.0.0 means “match all 32 bits”.
Router_D(config)#router ospf 100
Router_D(config-router)#network 10.10.3.17 0.0.0.0 area 0
Router_D(config-router)#network 172.16.0.6 0.0.0.0 area 0
Router_C(config)#router ospf 100
Router_C(config-router)#network 172.16.0.14 0.0.0.0 area 0
Router_C(config-router)#network 10.10.3.33 0.0.0.0 area 0
Router_B(config)#router ospf 100
Router_B(config-router)#network 172.16.0.9 0.0.0.0 area 0
Router_B(config-router)#network 172.16.0.13 0.0.0.0 area 0
Router_B(config-router)#network 172.16.0.5 0.0.0.0 area 0
Router_A(config)#router ospf 100
Router_A(config-router)#network 172.16.0.10 0.0.0.0 area 0
Router_A(config-router)#network 10.10.1.1 0.0.0.0 area 0
Figure 14.2  OSPF Configuration Commands
We could reduce the number of Router_B configuration commands by identifying all three directly connected networks with a single command shown in bold.
Router_B(config)#router ospf 100
Router_B(config-router)#network 172.16.0.0 0.0.255.255 area 0
In this case we are matching the first 16 bits since all serial connections of Router_B have the same most significant 16-bit pattern.
Verifying Configuration
Router_D#sh run
Building configuration...
Current configuration:
!
version 11.3
no service password-encryption
!
hostname Router_B
!
interface Ethernet0
  ip address 10.10.3.17 255.255.255.240
  no ip mroute-cache
  no fair-queue
interface Serial0
  ip address 172.16.0.6 255.255.255.252
  no ip mroute-cache
  no fair-queue
!
interface Serial1
no ip address
!
router ospf 100
  network 172.16.0.6 0.0.0.0 area 0
  network 10.10.3.17 0.0.0.0 area 0
!
ip classless
!
line con 0
line aux 0
line vty 0 4
login
!
end
Figure 14.3  The “show run” Command
Router_B#sh ip prot
Routing Protocol is "ospf 100"
  Sending updates every 0 seconds
  Invalid after 0 seconds, hold down 0, flushed after 0
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Redistributing: ospf 100
  Routing for Networks:
    172.16.0.9/32
    172.16.0.13/32
    172.16.0.5/32
  Routing Information Sources:
    Gateway         Distance      Last Update
    172.16.0.14        110         00:03:10
    172.16.0.10        110         00:12:19
    172.16.0.6         110         00:12:39
  Distance: (default is 110)
Figure 14.4  The “show ip protocol” Command
Viewing the Routing Table
Router_B#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
    U - per-user static route, o - ODR
Gateway of last resort is not set
  172.16.0.0/30 is subnetted, 3 subnets
C    172.16.0.12 is directly connected, Serial1
C    172.16.0.8 is directly connected, Serial0
C    172.16.0.4 is directly connected, Serial2
  10.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
O    10.10.1.0/24 [110/74] via 172.16.0.10, 00:09:24, Serial0
O    10.10.3.16/28 [110/879] via 172.16.0.6, 00:09:44, Serial2
O    10.10.3.32/28 [110/74] via 172.16.0.14, 00:00:16, Serial1
Figure 14.5  The “show ip route” Command
Table 14.2  Addresses of Figure 14.6
S0
S1
S2
E0–E7
Router_A
172.16.1.6
172.16.1.13
172.16.1.17
N/A
Router_B
172.16.1.5
172.16.1.9
N/A
N/A
Router_C
172.16.1.10
172.16.1.21
172.16.1.25
N/A
Router_A1
172.16.1.14
N/A
N/A
10.1.1.0 thru 10.1.8.0
Router_A2
172.16.1.18
N/A
N/A
10.1.9.0 thru 10.1.16.0
Router_C1
172.16.1.22
N/A
N/A
10.1.17.0 thur 10.1.24.2
Router_C2
172.16.1.26
N/A
N/A
10.1.25.0 thru 10.1.32.3
Mask
255.255.255.252
255.255.255.252
255.255.255.252
255.255.255.0
Router_B has 3 directly connected networks and 3 routes discovered by the OSPF process.
The default administrative distance of OSPF is 110.
The metric for OSPF is cost. Cost of each link is calculated by the following formula:
108/bandwidth of the link
As an example, a 10 mbps Ethernet link would have a cost of 10.
Types of OSPF Routers
  Internal routers have all of their interfaces in the same area.
  Area Border Routers (ABR) have interfaces in more than one area.
  Autonomous System Border Routers (ASBR) have interfaces in more than one AS.
  Backbone routers have an interface connected to Area 0.
Multiple-Area Topology
Figure 14.6  OSPF Multiple-Area Topology
  Router_B is a backbone router. We could also say that Router_B is an internal router since it has all interfaces in the same area.
  Routers A and C are ABRs.
  The remaining routers are internal routers.
The configuration of Router_B will be the same as shown in Figure 14.2.
Figure 14.7 illustrates how we will use the wild card mask to identify the 32 networks of the internal routers. In each case the least significant 3 bits of the 3rd and the 4th octets can have any value.
Router_A1(config)router ospf 100
Router_A1(config-router)#network 10.1.0.0 0 0.7.255 area 1
Router_A1(config-router)#network 172.16.0.0 0.0.255.255 area 1
Router_A2(config)router ospf 100
Router_A2(config-router)#network 10.1.8.0 0 0.7.255 area 2
Router_A2(config-router)#network 172.16.0.0 0.0.255.255 area 2
Router_C1(config)router ospf 100
Router_C1(config-router)#network 10.1.16.0 0 0.7.255 area 3
Router_C1(config-router)#network 172.16.0.0 0.0.255.255 area 3
Router_C2(config)router ospf 100
Router_C2(config-router)#network 10.1.24.0 0 0.7.255 area 4
Router_C2(config-router)#network 172.16.0.0 0.0.255.255 area 4
Figure 14.7  Configuration of Internal Routers
Router_A(config)router ospf 100
Router_A(config-router)#network 172.16.1.10 0.0.0.0 area 0
Router_A(config-router)#network 172.16.1.13 0.0.0.0 area 1
Router_A(config-router)#network 172.16.1.17.0.0.0.0 area 2
Router_A(config-router)#area 1 range 10.1.0.0 255.255.248.0
Router_A(config-router)#area 2 range 10.1.8.0 255.255.248.0
Router_C(config)router ospf 100
Router_C(config-router)#network 172.16.1.10 0.0.0.0 area 0
Router_C(config-router)#network 172.16.1.21 0.0.0.0 area 3
Router_C(config-router)#network 172.16.1.25 0.0.0.0 area 4
Router_C(config-router)#area 1 range 10.1.16.0 255.255.248.0
Router_C(config-router)#area 2 range 10.1.24.0 255.255.248.0
Figure 14.8  Configuration of the Area Border Routers with Summarization
Figure 14.8 shows the configuration statements necessary to perform interarea route summarization.
Keep in mind that the range statement uses a mask, NOT a wild card mask. Therefore the mask of 255.255.248.0 means that the first 21 bits must have a value that is the same as the associated address.
As we have summarized, Router_B will NOT have to “learn” each of the 8 networks associated with each area. One entry in the routing table will identify all 8 networks. Figure 14.9 illustrates this.
Router_B>sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
    U - per-user static route, o – ODR
Gateway of last resort is not set
  172.16.0.0/30 is subnetted, 3 subnets
O IA    172.16.1.12 [110/3570] via 172.16.1.6, 00:35:25, Serial0
O IA    172.16.1.16 [110/3570] via 172.16.1.6, 00:35:25, Serial0
O IA    172.16.1.20 [110/3570] via 172.16.1.6, 00:35:25, Serial1
O IA    172.16.1.24 [110/3570] via 172.16.1.6, 00:35:25, Serial1
C       172.16.1.8 is directly connected, Serial1
C       172.16.1.4 is directly connected, Serial0
    10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
O IA    10.1.8.0/21 [110/3570] via 172.16.1.6, 00:05:17, Serial0
O IA    10.1.0.0/21 [110/3570] via 172.16.1.6, 00:12:47, Serial0
O IA    10.1.16.0/21 [110/3570] via 172.16.1.10, 00:23:47, Serial1
O IA    10.1.24.0/21 [110/3570] via 172.16.1.10, 00:23:47, Serial1
Figure 14.9  Routing Table of Router _B
  Router_B now “knows” to send all packets for networks 10.1.0.0 through 10.1.15.0 to the serial 0 interface.
  Router_B now “knows” to send all packets for networks 10.1.16.0 through 10.1.31.0 to the serial 0 interface.
As we mentioned earlier, there is a cost associated with each route. The total cost to get to a network is the sum of the cost of each individual link. In Figure 14.9, 3570 represents the total cost of 2–56K links.
Different Types of OSPF Routes
The different types of OSPF routes are:
  Intra-area routes are routes in the same area (IA).
  Interarea routes are routes in different areas (O).
  External routes are routes in another autonomous system.
From the perspective of Router_B, all the networks are identified as IA because they are all interarea routes; all networks discovered through the OSPF process are NOT in area 0.
Now take a look at the LAN links of Router_A1. We can see if a host is attached to one of these LAN links and that host needs to communicate with an interarea network, the traffic MUST go to the Serial 1 interface of Router_A.
Figure 14.6 illustrates that from Router_A1’s perspective there are exactly 24 interarea LAN networks.
Why would it be necessary for Router_A1 to keep these 24 networks in its routing table when initially, in each case, to get to these networks all packets will go to the same interface, the Serial 1 of Router_A?
Totally Stubby Areas
Cisco has created a proprietary feature called “totally stubby”.
When an area is defined as totally stubby, all routers within that area will NOT see the interarea routes. The size of the routing table will therefore be reduced.
The bolded statements of Figures 14.10 and 14.11 are all that is necessary to configure a totally stubby area.
Router_A(config)router ospf 100
Router_A(config-router)network 172.16.1.6 0.0.0.0 area 0
contined on next page
Router_A(config-router)network 172.16.1.13 0.0.0.0 area 1
Router_A(config-router)network 10.0.0.0 0.255.255.255 area 2
Router_A(config-router)area 1 stub no-summary
Router_A(config-router)area 2 stub no-summary
Router_A(config-router)area 1 range 10.1.0.0 255.255.248.0
Router_A(config-router)area 2 range 10.1.8.0 255.255.248.0
Figure 14.10  Configuring an ABR Defining a “Totally Stubby” Area
Router_A1(config)router ospf 100
Router_A1(config-router)network 172.16.1.0 0.0.0.255 area 1
Router_A1(config-router)network 10.0.0.0 0.255.255.255 area 1
Router_A1(config-router)area 1 stub
Router_A2(config)router ospf 100
Router_A2(config-router)network 172.16.1.0 0.0.0.255 area 2
Router_A2(config-router)network 10.0.0.0 0.255.255.255 area 2
Router_A2(config-router)area 2 stub
Figure 14.11  Configuring an Internal Router to be in a “Totally Stubby” Area
Figure 14.12 shows the result of configuring a “totally stubby” area. Notice that Router_A1 now has a gateway of last resort set to the Serial 1 interface of Router_A.
Router_A1>sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
    U - per-user static route, o – ODR
Gateway of last resort is 172.16.1.13 to network 0.0.0.0
  172.16.0.0/30 is subnetted, 1 subnets
C     172.16.1.12 is directly connected, Serial0/0
  10.0.0.0/24 is subnetted, 1 subnets
C    10.1.1.0 is directly connected, Ethernet0/0
O*IA 0.0.0.0/0 [110/1786] via 172.16.1.13, 02:20:55, Serial0/0
<Partial listing>
Figure 14.12  Result of Configuring a “Totally Stubby” Area
A “totally stubby” area will also hide external routes. As a result a router in a “totally stubby” area will only see intra-area routes in addition to its directly connected networks.
Multiple Autonomous Systems
Figure 14.13  Multiple Autonomous System Topology
The same logic we used about reasoning for hiding interarea routes could be applied to the hiding of external routes. Why would it be necessary for internal routers to maintain information about external routes if there is only one way to get to them?
Stub Areas
OSPF defines a “stub” area as one in which all external routes are hidden. Interarea routes would NOT be hidden in a “stub area” configuration. In this case Router_A1 would still maintain all interarea routes. A “totally stubby” configuration offers the additional advantage of hiding not only external routes but also interarea routes.
To configure a “stub” area we would use the same configuration lines as in Figures 14.9 and 14.10, but would remove the switch “no-summary”.
A stub area is a standard and not a Cisco proprietary.
IP/OSPF Addressing Design
Here is an IP addressing scheme to illustrate how the IP address can be used to define location of hosts. In our example we are going to use a private address; private addresses will be discussed in more detail in Chapter 17.
Figure 14.14 represents an organization with a home office and four remote locations.
  The 1st octet value of 10 signifies a private address.
  The 2nd octet will signify a location. For instance, we know that a host with an address of 10.4.x.x is located in NYC. Again, this is the same idea as my post office analogy; we know that a ZIP code that begins with a 9 is located on the West Coast.
  The 3rd octet represents the floor of the location. As an example, a host with the address of 10.2.3.x is located at the San Fran site on the third floor.
Since we are using OSPF we can take advantage of VLSM. Table 14.3 shows an example of addresses we can use for our serial connections.
Table 14.3  IP/OSPF Addressing Serial Connection Design
S0
S1
S2
S3
Jacksonville
10.1.100.5
10.2.100.5
10.3.100.5
10.4.100.5
Dallas
10.1.100.6
N/A
N/A
N/A
San-Fran
N/A
10.2.100.6
N/A
N/A
Tallahassee
N/A
N/A
10.3.100.6
N/A
Jacksonville
N/A
N/A
N/A
10.4.100.5
  *All serial connections will use the 255.255.255.252 mask.
I have chosen a 3rd-octet value of 100 to signify all serial connections. The idea is that we will not have a site with 100 floors.
All interfaces of the Jacksonville router will have a host portion value of 5. All serial interfaces of the remote routers will have a host portion value of 6.
The reason I did not choose the host values of 1 and 2 had to do with the zero subnet restrictions.
Figure 14.14  IP/OSPF Addressing Design
Now let us consider a different logic for assigning IP addresses. Suppose that we have a lot of user movement. A user might be on the first floor today but on the fifth floor tomorrow. Maybe we could use the 3rd octet to describe department, not the floor. As an example: accounting might have a 3rd-octet value of 1, sales might have a 3rd-octet value of 2, engineering might have a 3rd-octet value of 3, etc.
Now, when there is a change of location the user can take his machine with him and there is no need for reprogramming.
In a switching environment the administrator will define a port to be associated with a VLAN. Each VLAN will represent a department. For instance the accounting department will be assigned VLAN 1, which may be made up of ports 5 and 6. When the user is moved up to the fifth floor the administrator will connect the user to port 5 or 6.
For more information about Cisco switching, I recommend the book Cisco Catalyst LAN Switching by Lou Rossi Jr., McGraw-Hill, New York: NY.

 


 
Books24x7.com, Inc © 2000 –  Feedback